from PIL import Image, ImageDraw

def create_icon(size):
    # Create a new image with a white background
    img = Image.new('RGBA', (size, size), (255, 255, 255, 0))
    draw = ImageDraw.Draw(img)
    
    # Calculate dimensions for the camera icon
    padding = size // 4
    body_width = size - (2 * padding)
    body_height = int(body_width * 0.8)
    lens_size = size // 3
    
    # Draw camera body (rectangle)
    body_left = padding
    body_top = padding + (size - padding * 2 - body_height) // 2
    draw.rectangle(
        [(body_left, body_top), (body_left + body_width, body_top + body_height)],
        fill=(66, 133, 244),  # Google Blue
        outline=(59, 120, 220),
        width=max(1, size // 16)
    )
    
    # Draw camera lens (circle)
    lens_left = (size - lens_size) // 2
    lens_top = body_top + (body_height - lens_size) // 2
    draw.ellipse(
        [(lens_left, lens_top), (lens_left + lens_size, lens_top + lens_size)],
        fill=(59, 120, 220),  # Darker Blue
        outline=(48, 97, 177),
        width=max(1, size // 16)
    )
    
    return img

# Generate icons in different sizes
sizes = [16, 48, 128]
for size in sizes:
    icon = create_icon(size)
    icon.save(f'images/icon{size}.png', 'PNG')
